/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package domain;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author f35
 */
@Entity
@Table(name = "rol_pagos")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RolPagos.findAll", query = "SELECT r FROM RolPagos r"),
    @NamedQuery(name = "RolPagos.findByIdRolPagos", query = "SELECT r FROM RolPagos r WHERE r.idRolPagos = :idRolPagos"),
    @NamedQuery(name = "RolPagos.findByComiciones", query = "SELECT r FROM RolPagos r WHERE r.comiciones = :comiciones"),
    @NamedQuery(name = "RolPagos.findByAportePersonal", query = "SELECT r FROM RolPagos r WHERE r.aportePersonal = :aportePersonal"),
    @NamedQuery(name = "RolPagos.findByMultas", query = "SELECT r FROM RolPagos r WHERE r.multas = :multas"),
    @NamedQuery(name = "RolPagos.findByAnticipos", query = "SELECT r FROM RolPagos r WHERE r.anticipos = :anticipos"),
    @NamedQuery(name = "RolPagos.findByComisariato", query = "SELECT r FROM RolPagos r WHERE r.comisariato = :comisariato"),
    @NamedQuery(name = "RolPagos.findByFecha", query = "SELECT r FROM RolPagos r WHERE r.fecha = :fecha")})
public class RolPagos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idRol_Pagos")
    private Integer idRolPagos;
    @Basic(optional = false)
    @NotNull
    @Column(name = "comiciones")
    private float comiciones;
    @Size(max = 45)
    @Column(name = "aporte_personal")
    private String aportePersonal;
    @Size(max = 45)
    @Column(name = "multas")
    private String multas;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "anticipos")
    private Float anticipos;
    @Size(max = 45)
    @Column(name = "comisariato")
    private String comisariato;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "rolPagos")
    private Collection<Empleado> empleadoCollection;

    public RolPagos() {
    }

    public RolPagos(Integer idRolPagos) {
        this.idRolPagos = idRolPagos;
    }

    public RolPagos(Integer idRolPagos, float comiciones) {
        this.idRolPagos = idRolPagos;
        this.comiciones = comiciones;
    }

    public Integer getIdRolPagos() {
        return idRolPagos;
    }

    public void setIdRolPagos(Integer idRolPagos) {
        this.idRolPagos = idRolPagos;
    }

    public float getComiciones() {
        return comiciones;
    }

    public void setComiciones(float comiciones) {
        this.comiciones = comiciones;
    }

    public String getAportePersonal() {
        return aportePersonal;
    }

    public void setAportePersonal(String aportePersonal) {
        this.aportePersonal = aportePersonal;
    }

    public String getMultas() {
        return multas;
    }

    public void setMultas(String multas) {
        this.multas = multas;
    }

    public Float getAnticipos() {
        return anticipos;
    }

    public void setAnticipos(Float anticipos) {
        this.anticipos = anticipos;
    }

    public String getComisariato() {
        return comisariato;
    }

    public void setComisariato(String comisariato) {
        this.comisariato = comisariato;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    @XmlTransient
    public Collection<Empleado> getEmpleadoCollection() {
        return empleadoCollection;
    }

    public void setEmpleadoCollection(Collection<Empleado> empleadoCollection) {
        this.empleadoCollection = empleadoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRolPagos != null ? idRolPagos.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RolPagos)) {
            return false;
        }
        RolPagos other = (RolPagos) object;
        if ((this.idRolPagos == null && other.idRolPagos != null) || (this.idRolPagos != null && !this.idRolPagos.equals(other.idRolPagos))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "domain.RolPagos[ idRolPagos=" + idRolPagos + " ]";
    }
    
}
